package main

import (
    "log"

    "github.com/jinzhu/gorm"
    _ "github.com/jinzhu/gorm/dialects/postgres"
    _ "github.com/spaolacci/murmur3"
)

func main() {
    //连接数据库
    db, err := gorm.Open("postgres", "host=127.0.0.1 port=5352 user=postgres dbname=postgres password=swx0101 sslmode=disable")
    if err != nil {
        log.Println(err)
    } else {
        log.Println("连接成功！")
    }
    defer db.Close()
}